package com.carltechnology.mahjonggamecaculation.base;

import com.carltechnology.mahjonggamecaculation.mode.IGameData;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by WZTCM on 2016/6/28.
 * this class used for storing the temporary GameDataMode and GameDetailMode.
 * They do do poly in our app when we switching our ui.
 */
public class MahjongDataPool {
    private IGameData gameMode;
   // private IDetailGameData detailMode;
    private List<Integer> list;
    private int perUnit;
    public MahjongDataPool() {
        list = new CopyOnWriteArrayList<>();
    }

    public int getPerUnit() {
        return perUnit;
    }

    public void setPerUnit(int perUnit) {
        this.perUnit = perUnit;
    }

    public synchronized IGameData getGameMode() {
        return gameMode;
    }

    public synchronized void setGameMode(IGameData gameMode) {
        this.gameMode = gameMode;
    }


    public void add(int tmp){
        Integer intTmp = new Integer(tmp);
        list.add(intTmp);
    }
    public boolean checkId(int id){
        return list.contains(id);
    }
}
